home *** CD-ROM | disk | FTP | other *** search
/ Clickx 47 / Clickx 47.iso / assets / software / sswitchxp152.exe / source / SpeedswitchXP / HyperLink.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-14  |  3.2 KB  |  101 lines

  1. // HyperLink.h : header file
  2. //
  3. //
  4. // HyperLink static control. Will open the default browser with the given URL
  5. // when the user clicks on the link.
  6. //
  7. // Copyright Chris Maunder, 1997, 1998
  8. // Feel free to use and distribute. May not be sold for profit. 
  9.  
  10. #if !defined(AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_)
  11. #define AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_
  12.  
  13. #if _MSC_VER >= 1000
  14. #pragma once
  15. #endif // _MSC_VER >= 1000
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CHyperLink window
  19.  
  20. class CHyperLink : public CStatic
  21. {
  22. // Construction/destruction
  23. public:
  24.     CHyperLink();
  25.     virtual ~CHyperLink();
  26.  
  27. // Attributes
  28. public:
  29.  
  30. // Operations
  31. public:
  32.  
  33.     void SetURL(CString strURL);
  34.     CString GetURL() const;
  35.  
  36.     void SetColours(COLORREF crLinkColour, COLORREF crVisitedColour, 
  37.                     COLORREF crHoverColour = -1);
  38.     COLORREF GetLinkColour() const;
  39.     COLORREF GetVisitedColour() const;
  40.     COLORREF GetHoverColour() const;
  41.  
  42.     void SetVisited(BOOL bVisited = TRUE);
  43.     BOOL GetVisited() const;
  44.  
  45.     void SetLinkCursor(HCURSOR hCursor);
  46.     HCURSOR GetLinkCursor() const;
  47.  
  48.     void SetUnderline(BOOL bUnderline = TRUE);
  49.     BOOL GetUnderline() const;
  50.  
  51.     void SetAutoSize(BOOL bAutoSize = TRUE);
  52.     BOOL GetAutoSize() const;
  53.  
  54. // Overrides
  55.     // ClassWizard generated virtual function overrides
  56.     //{{AFX_VIRTUAL(CHyperLink)
  57.     public:
  58.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  59.     protected:
  60.     virtual void PreSubclassWindow();
  61.     //}}AFX_VIRTUAL
  62.  
  63. // Implementation
  64. protected:
  65.     BOOL GotoURL(LPCTSTR url, int showcmd);
  66.     void ReportError(int nError);
  67.     LONG GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata);
  68.     void PositionWindow();
  69.     void SetDefaultCursor();
  70.  
  71. // Protected attributes
  72. protected:
  73.     COLORREF m_crLinkColour, m_crVisitedColour;     // Hyperlink colours
  74.     COLORREF m_crHoverColour;                       // Hover colour
  75.     BOOL     m_bOverControl;                        // cursor over control?
  76.     BOOL     m_bVisited;                            // Has it been visited?
  77.     BOOL     m_bUnderline;                          // underline hyperlink?
  78.     BOOL     m_bAdjustToFit;                        // Adjust window size to fit text?
  79.     CString  m_strURL;                              // hyperlink URL
  80.     CFont    m_Font;                                // Underline font if necessary
  81.     HCURSOR  m_hLinkCursor;                         // Cursor for hyperlink
  82.     CToolTipCtrl m_ToolTip;                         // The tooltip
  83.  
  84.     // Generated message map functions
  85. protected:
  86.     //{{AFX_MSG(CHyperLink)
  87.     afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
  88.     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  89.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  90.     //}}AFX_MSG
  91.     afx_msg void OnClicked();
  92.     DECLARE_MESSAGE_MAP()
  93. };
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96.  
  97. //{{AFX_INSERT_LOCATION}}
  98. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  99.  
  100. #endif // !defined(AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_)
  101.